@echo off

echo start complie app code
echo .

set boot=new
set app=1
set spi_speed=40
set spi_mode=DIO
set spi_size_map=6

echo STEP 1: boot mode(0=boot_v1.1, 1=boot_v1.2+, 2=none):
echo %boot%

echo STEP 2: bin generate(0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin):
echo %app%

echo STEP 3: spi speed(0=20MHz, 1=26.7MHz, 2=40MHz, 3=80MHz):
echo %spi_speed% MHz

echo STEP 4: spi mode(0=QIO, 1=QOUT, 2=DIO, 3=DOUT):
echo %spi_mode%

echo STEP 5: flash size and map:
echo     0= 512KB( 256KB+ 256KB)
echo     2=1024KB( 512KB+ 512KB)
echo     3=2048KB( 512KB+ 512KB)
echo     4=4096KB( 512KB+ 512KB)
echo     5=2048KB(1024KB+1024KB)
echo     6=4096KB(1024KB+1024KB)
echo flash size and map: %spi_size_map%

touch user/user_main.c

echo.
echo start...
echo.

make COMPILE=gcc BOOT=%boot% APP=%app% SPI_SPEED=%spi_speed% SPI_MODE=%spi_mode% SPI_SIZE_MAP=%spi_size_map%
